<template>
  <div class='dataAsset-main'>
    <h2>数据资产统计</h2>
    <div class='content-menu'>
      <el-form ref="searchData" :model="searchData" size="small">
        <el-form-item label="油田:" prop='name' label-width='50px' style='padding-right: 30px;'>
          <el-select v-model="searchData.name" prop='name'>
            <el-option label="全部" value=""></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="数据内容:" label-width='80px' prop='num'>
          <el-select v-model="searchData.num">
            <el-option label="结构化数据" value='结构化数据'></el-option>
            <el-option label="非结构化数据" value='非结构化数据'></el-option>
          </el-select>
        </el-form-item>
        <el-form-item style='text-align:right;width:150px;float:right'>
          <el-button type="primary" @click='chack' size='mini'>查询</el-button>
          <el-button @click="resetForm('searchData')" size='mini'>重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class='content-main'>
      <h3>资产统计-{{chacked.num}}<el-button size='mini'>导出</el-button></h3>
      <table-list :chacked='chacked'></table-list>
    </div>
    <div class='content-main'>
      <h3>趋势统计-{{chacked.num}}
    			<el-select size='small' v-model='trendChacted'>
    				<el-option v-for='(item,index) in trendList' :label='item.name' :value='item.code' :key='index'></el-option>
    			</el-select>
    		</h3>
      <trend-list :trendChacted='trendChacted' :chacked='chacked'></trend-list>
    </div>
  </div>
</template>

<script>
  import TableList from './components/TableList'
  import TrendList from './components/TrendList'
  export default {
    name: 'taskFlow',
    components: {
      TableList,
      TrendList
    },
    data() {
      return {
        trendChacted: '物探工程',      
        trendList: [
          {
            name: '物探工程',
            code: '物探工程'
          },
          {
            name: '井筒工程',
            code: '井筒工程'
          },
          {
            name: '油藏工程',
            code: '油藏工程'
          },
          {
            name: '采油工程',
            code: '采油工程'
          },
          {
            name: '地面工程',
            code: '地面工程'
          }
        ],
        searchData: {
          name: '',
          num: '结构化数据'
        },
        chacked: {}
      }
    },
    created() {
      this.chacked = JSON.parse(JSON.stringify(this.searchData))
    },
    methods: {
      resetForm(formName) {
        this.$refs[formName].resetFields()
      },
      chack() {
        this.chacked = JSON.parse(JSON.stringify(this.searchData))
      }
    }
  }
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
  .dataAsset-main {
    padding: 0 20px 20px 20px;
    color: #666;
    h2 {
      height: 56px;
      line-height: 56px;
      color: #333;
      font-weight: normal;
      font-size: 18px;
    }
    .content-menu {
      background: #fff;
      padding: 20px;
      height: 72px;
      .el-form {
        .el-form-item {
          width: calc(50% - 80px);
          float: left;
          .el-select {
            width: 100%;
          }
        }
      }
    }
    .content-main {
      background: #fff;
      margin-top: 20px;
      padding: 10px 20px 20px 20px;
      &>h3 {
        line-height: 54px;
        height: 54px;
        font-size: 18px;
        font-weight: normal;
        border-bottom: 1px solid #ededed;
        margin-bottom: 20px;
        .el-button {
          margin-top: 8px;
          float: right;
          font-size: 14px;
        }
        .el-select {
          margin-top: -3px;
          float: right;
        }
      }
    }
  }
</style>
